package com.imesne;

import com.jfinal.template.ext.spring.JFinalViewResolver;
import com.jfinal.template.source.ClassPathSourceFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by liyd on 17/8/15.
 */
@Configuration
public class EnjoyConfig {

    @Bean
    public JFinalViewResolver jFinalViewResolver() {
        JFinalViewResolver jfr = new JFinalViewResolver();
        jfr.setDevMode(false);
        jfr.setSourceFactory(new ClassPathSourceFactory());
        jfr.setPrefix("/templates/");
        jfr.setSuffix(".html");
        jfr.setContentType("text/html;charset=UTF-8");
        jfr.setOrder(0);

        return jfr;
    }
}
